isBidirectionalRangeErrorFormatter

This function produces a descriptive message why R is not an BidirectionalRange. If R is an BidirectionalRange the returned string will say so.

@safe pure
string
isBidirectionalRangeErrorFormatter
(
R
)
()

Examples

ditto

struct Foo {}
enum msg = isBidirectionalRangeErrorFormatter!(Foo);
enum exp =`Foo is not an BidirectionalRange because
the property 'empty' does not exist
and the property 'front' does not exist
and the function 'popFront' does not exist
and the property 'back' does not exist
and the function 'popBack' does not exist`;
static assert(msg == exp, "\n" ~ msg ~ "\n" ~ exp);
string msg2 = isBidirectionalRangeErrorFormatter!(Foo);
assert(msg2 == exp, msg ~ "\n" ~ exp);

ditto

struct Foo {
	int empty;
}
enum msg = isBidirectionalRangeErrorFormatter!(Foo);
enum exp =`Foo is not an BidirectionalRange because
the property 'empty' is not of type 'bool' but 'int'
and the property 'front' does not exist
and the function 'popFront' does not exist
and the property 'back' does not exist
and the function 'popBack' does not exist`;
static assert(msg == exp, "\n" ~ msg ~ "\n" ~ exp);
string msg2 = isBidirectionalRangeErrorFormatter!(Foo);
assert(msg2 == exp, msg ~ "\n" ~ exp);

ditto

struct Foo {
	bool empty;
	void front();
}
enum msg = isBidirectionalRangeErrorFormatter!(Foo);
enum exp =`Foo is not an BidirectionalRange because
the property 'front' does not return a non 'void' value
and the function 'popFront' does not exist
and the property 'back' does not exist
and the function 'popBack' does not exist`;
static assert(msg == exp, "\n" ~ msg ~ "\n" ~ exp);
string msg2 = isBidirectionalRangeErrorFormatter!(Foo);
assert(msg2 == exp, msg ~ "\n" ~ exp);

ditto

struct Foo {
	bool empty;
	int front();
}
enum msg = isBidirectionalRangeErrorFormatter!(Foo);
enum exp =`Foo is not an BidirectionalRange because
the function 'popFront' does not exist
and the property 'back' does not exist
and the function 'popBack' does not exist`;
static assert(msg == exp, "\n" ~ msg ~ "\n" ~ exp);
string msg2 = isBidirectionalRangeErrorFormatter!(Foo);
assert(msg2 == exp, msg ~ "\n" ~ exp);

ditto

struct Foo {
	bool empty;
	int front();
	void popFront();
	float back();
}
enum msg = isBidirectionalRangeErrorFormatter!(Foo);
enum exp =`Foo is not an BidirectionalRange because
the property 'back' does return a 'float' which is not equal to the type of 'front' which is 'int'
and the function 'popBack' does not exist`;
static assert(msg == exp, "\n" ~ msg ~ "\n" ~ exp);
string msg2 = isBidirectionalRangeErrorFormatter!(Foo);
assert(msg2 == exp, "\n" ~ msg ~ "\n" ~ exp);

ditto

struct Foo {
	bool empty;
	int front();
	void popFront();
	float back();
}
enum msg = isBidirectionalRangeErrorFormatter!(Foo);
enum exp =`Foo is not an BidirectionalRange because
the property 'back' does return a 'float' which is not equal to the type of 'front' which is 'int'
and the function 'popBack' does not exist`;
static assert(msg == exp, "\n" ~ msg ~ "\n" ~ exp);
string msg2 = isBidirectionalRangeErrorFormatter!(Foo);
assert(msg2 == exp, "\n" ~ msg ~ "\n" ~ exp);

ditto

struct Foo {
	bool empty;
	int front();
	void popFront();
	int back();

}
enum msg = isBidirectionalRangeErrorFormatter!(Foo);
enum exp =`Foo is not an BidirectionalRange because
the function 'popBack' does not exist`;
static assert(msg == exp, "\n" ~ msg ~ "\n" ~ exp);
string msg2 = isBidirectionalRangeErrorFormatter!(Foo);
assert(msg2 == exp, "\n" ~ msg ~ "\n" ~ exp);

ditto

struct Foo {
	bool empty;
	int front();
	void popFront();
	int back();
	void popBack();

}
enum msg = isBidirectionalRangeErrorFormatter!(Foo);
static assert(msg == "Foo is an BidirectionalRange", msg);
string msg2 = isBidirectionalRangeErrorFormatter!(Foo);
assert(msg2 == "Foo is an BidirectionalRange", msg);

Meta